<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人信息修改</title>
<script type="text/javascript">

function update(){
	var opas = document.f.opassword.value;
	var npas = document.f.npassword.value;
	var npas2 = document.f.npassword2.value;
	if(opas==""){
		alert("请输入密码");
	}else if(npas!=""&&npas2!=npas){
		document.f.npassword.value = "";
		document.f.npassword2.value="";
		alert("您两次输入的密码不一致");
	}else if(npas!=""&&opas==npas){
		alert("修改的新密码和原密码一致");
	}else{
		document.f.submit();
	}
}
</script>
</head>
<body>
<jsp:include page="head.jsp"/>
<form action="BuyerUpdateServlet" name="f">
旧密码:&nbsp;<input type="password" name="opassword"><br>
新密码:&nbsp;<input type="password" name="npassword"><br>
确认密码:<input type="password" name="npassword2"><br>
昵称:&nbsp;&nbsp;<input type="text" name="nickname" value="${user.userNickname}"><br>
手机号:&nbsp;<input type="text" name="phone" value="${user.userPhone}"><br>
真实姓名:<input type="text" name="truename" value="${user.userTruename}"><br>
证件号:&nbsp;<input type="text" name="idnumber" value="${user.userIdnumber}"><br>
<input type="button" value="修改" onclick="update();">
</form>
</body>
</html>